import os
import platform
import shutil

print('plat=', platform.system().lower())


def clear(filepath):
    files = os.listdir(filepath)
    for fd in files:
        cur_path = os.path.join(filepath, fd)
        if os.path.isdir(cur_path):
            if fd == '__pycache__' or fd == 'log':
                print('will del folder=', cur_path)
                shutil.rmtree(cur_path)
            else:
                clear(cur_path)


if __name__ == "__main__":
    clear(".")